var _EsdDynamicTransformationFunction = function($){
/**
 * 命名空间定义
 */
var _EsdDynamicTransformationScript = {};
_EsdDynamicTransformationScript.navBlock = {}; // 定义区域跳转类
_EsdDynamicTransformationScript.navBlock.selector = {};
/**
 * 文本链接 a
 */
//保证所有a标签都有href
$("a").each(function(){

	var aHref = this.href;
	if( aHref=="" || aHref==undefined ){
			$(this).attr("href","javascript:void(0)");
	}
	
	//给a标签加title
	var aTitle = this.title;
	var aText = this.text;
	
	if( aTitle=="" || aTitle==undefined ){
		if( aText!="" || aText!=undefined ){
			$(this).attr("title",$.trim(aText));
		}
	}
	
});
/**
 * 图片处理片段
 */

$('img[src="./images/jlsgjsyswgllfdxc_syw20170516.jpg"]').attr('title', '房地产管理').attr('alt', '房地产管理');
$('img[src="./images/jlsgjsyswglywlc_syw20161128.jpg"]').attr('title', '业务流程').attr('alt', '业务流程');
$('img[src="../images/jlsgjsyycxxkhyzx01_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./images/jlsgjsynavsy_syw20161128.png"]').attr('title', '首页').attr('alt', '首页');
$('img[src="./images/jlsgjsyswglggjn_syw20161128.jpg"]').attr('title', '公共机构节能').attr('alt', '公共机构节能');
$('img[src="./images/jlsgusyxxgkgkjdkh_syw20161128.jpg"]').attr('title', '公开监督考核').attr('alt', '公开监督考核');
$('img[src="./xwzx/tpxw/201909/W020190930330234333329.jpg"]').attr('title', '松原市管局开展公车信息化管理平台业务培训').attr('alt', '松原市管局开展公车信息化管理平台业务培训');
$('img[src="http://121.43.68.40/exposure/images/jiucuo.png?v=2200000075"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="../images/jlsgjxwzxsjdt_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./images/jlsgjsyjlhdtb_syw20161128.png"]').attr('title', '互动交流').attr('alt', '互动交流');
$('img[src="./images/jlsgjsyswglbszn_syw20161128.jpg"]').attr('title', '办事指南').attr('alt', '办事指南');
$('img[src="./images/jlsgjsyswgllgyzc_syw20161128.jpg"]').attr('title', '国有资产管理').attr('alt', '国有资产管理');
$('img[src="./images/jlsgusyxxgkgkzn_syw20161128.jpg"]').attr('title', '信息公开指南').attr('alt', '信息公开指南');
$('img[src="./images/jlsgusyjzxx_syw20161128.jpg"]').attr('title', '局长信箱').attr('alt', '局长信箱');
$('img[src="./images/jlsgjsynavhdjl_syw20161128.png"]').attr('title', '互动交流').attr('alt', '互动交流');
$('img[src="./images/jlsgusyjdts_syw20161128.jpg"]').attr('title', '监督投诉').attr('alt', '监督投诉');
$('img[src="./images/jlsgjsyycxwbtbt02_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="../images/jlsgjjgzn01_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./images/jlsgjsyswglbgfw_syw20161128.jpg"]').attr('title', '宾馆服务').attr('alt', '宾馆服务');
$('img[src="./images/jlsgjsynavxwzx_syw20161128.png"]').attr('title', '新闻资讯').attr('alt', '新闻资讯');
$('img[src="./images/jlsgjsynavjgzn_syw20161128.png"]').attr('title', '概况信息').attr('alt', '概况信息');
$('img[src="./images/jlsgjsyswglrsgz_syw20161128.jpg"]').attr('title', '人事工作').attr('alt', '人事工作');
$('img[src="./xwzx/tpxw/201911/W020191108581575866204.jpg"]').attr('title', '辽源市召开党政机关公务用车信息化管理平台应用培训会').attr('alt', '辽源市召开党政机关公务用车信息化管理平台应用培训会');
$('img[src="./images/jlsgusyxxgkndbg_syw20161128.jpg"]').attr('title', '信息公开年度工作报告').attr('alt', '信息公开年度工作报告');
$('img[src="./images/jlsgjsyycxwbtbt01_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="../images/jlsgjxwzxsytb_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="../images/jlsgjsyycxxksxxx01_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./images/jlsgjsyswglzfzd_syw20161128.jpg"]').attr('title', '住房制度改革').attr('alt', '住房制度改革');
$('img[src="./images/jlsgjsynavxigk_syw20161128.png"]').attr('title', '信息公开').attr('alt', '信息公开');
$('img[src="./images/jlsgusyzxzx_syw20161128.jpg"]').attr('title', '在线咨询').attr('alt', '在线咨询');
$('img[src="./images/jlsgjsyswgllcgl_syw2018.jpg"]').attr('title', '预决算信息').attr('alt', '预决算信息');
$('img[src="./images/jlsgjsyswglyrjy_syw20161128.jpg"]').attr('title', '幼儿教育').attr('alt', '幼儿教育');
$('img[src="./images/jlsgjsyjlhdwd_syw20161128.png"]').attr('title', '热点问答').attr('alt', '热点问答');
$('img[src="../images/jlsgjjgzn03_syw20161128.png"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./images/jlsgusyxxgkgkml_syw20161128.jpg"]').attr('title', '信息公开目录').attr('alt', '信息公开目录');
$('img[src="./images/jlsgjsyswglzlxz_syw20161128.jpg"]').attr('title', '资料下载').attr('alt', '资料下载');
$('img[src="./images/jlsgusyxxgkgkyj_syw20161128.jpg"]').attr('title', '信息公开依据').attr('alt', '信息公开依据');
$('img[src="./images/jlsgjsybannder01_syw20161128.png"]').attr('title', '科学 规范 务实 服务').attr('alt', '科学 规范 务实 服务');
$('img[src="./xwzx/tpxw/201910/W020191014588038735952.jpg"]').attr('title', '长春市管局组织参观庆祝新中国成立70周年主题展览').attr('alt', '长春市管局组织参观庆祝新中国成立70周年主题展览');
$('img[src="./images/jlsgjsyswglzhfu_syw20161128.jpg"]').attr('title', '综合服务').attr('alt', '综合服务');
$('img[src="./images/jlsgjsyswglqlqd_syw20181029.jpg"]').attr('title', '权责清单').attr('alt', '权责清单');
$('img[src="./images/jlsgusyjdtxhb_syw20161128.jpg"]').attr('title', '装饰图片').attr('alt', '装饰图片');
$('img[src="./xwzx/tpxw/201910/W020191025476992506024.jpg"]').attr('title', '省管局举办张富清同志先进事迹情景报告会').attr('alt', '省管局举办张富清同志先进事迹情景报告会');
$('img[src="./images/jlsgjsylogo_syw20181025.png"]').attr('title', '吉林省机关事务管理局').attr('alt', '吉林省机关事务管理局');
$('img[src="./images/icon_ba2018.png"]').attr('title', '吉公网安备').attr('alt', '吉公网安备');
$('img[src="//dcs.conac.cn/image/red.png"]').attr('title', '党政机关图标').attr('alt', '党政机关图标');
$('img[src="./images/jlsgusyxxgksqgk_syw20161128.jpg"]').attr('title', '依申请公开').attr('alt', '依申请公开');
$('img[src="./images/jlsgjsyxxgktb_syw20161128.png"]').attr('title', '信息公开').attr('alt', '信息公开');
$('img[src="./images/jlsgjsyswglbttb_syw20161128.png"]').attr('title', '事务管理').attr('alt', '事务管理');
$('img[src="./images/jlsgjsyswglcl_syw20161128.jpg"]').attr('title', '车辆管理').attr('alt', '车辆管理');
$('img[src="./images/jlsgjsyswglbsxt_syw20161128.jpg"]').attr('title', '机关事务报送系统').attr('alt', '机关事务报送系统');
$('img[src="./images/jlsgusyzjdc_syw20161128.jpg"]').attr('title', '调查征集').attr('alt', '调查征集');
$('img[src="./xwzx/tpxw/201912/W020191206581281893202.jpg"]').attr('title', '白山市管局荣获“国家级节约型公共机构示范单位”称号').attr('alt', '白山市管局荣获“国家级节约型公共机构示范单位”称号');
$('img[src="./images/jlsgjsyswglgjj_syw20161128.jpg"]').attr('title', '省直公积金管理').attr('alt', '省直公积金管理');
$('img[src="./images/jlsgjsyzyxxzz_syw20161128.png"]').attr('title', '重要信息转载').attr('alt', '重要信息转载');

//img
$("img").each(function(){
	//给图片加alt/title
	var imgAlt = this.alt,
		imgTitle = this.title,
		imgSrc = this.src,
		parentText = this.parentElement.text;

	if(this.alt=="" || this.alt==undefined){
		if(imgTitle!="" && imgTitle!=undefined){
			$(this).attr("alt",imgTitle);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("alt",parentText);
		}
	}
	if(this.title=="" || this.title==undefined){
		if(imgAlt!="" && imgAlt!=undefined){
			$(this).attr("title",imgAlt);
		}else if(parentText!="" && parentText!=undefined){
			$(this).attr("title",parentText);
		}
	}
})

$("img").each(function(){
	if( (this.alt=="" && this.title=="")||(this.alt==undefined && this.title==undefined) ){
		$(this).attr("title","图片");
		$(this).attr("alt","图片");
	}
})
/**
 * 共通头部
 */
$("form[name='form_cds'] input[type='button']").attr("title","搜索");
/**
 * 主导航
 */

//轮播,右下角原点--鼠标移动触发情况

//轮播：只获取轮播中一个a标签。
//以文字a标签为主，图片a标签尽量不要，title不稳定
if(location.href == "http://sgj.jl.gov.cn/index.html" || location.href == "http://sgj.jl.gov.cn/"){
	//轮播前的标签
	_EsdDynamicTransformationScript.esdTagFrontNum1 = $(".syw_sgj_foot_bj .syw_sgj_nav_box li:eq(4) a");
	
	//文字A标签
	_EsdDynamicTransformationScript.esdTagANum1 = $("#D1pic1 .fcon:eq(0) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum2 = $("#D1pic1 .fcon:eq(1) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum3 = $("#D1pic1 .fcon:eq(2) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum4 = $("#D1pic1 .fcon:eq(3) .shadow a");
	_EsdDynamicTransformationScript.esdTagANum5 = $("#D1pic1 .fcon:eq(4) .shadow a");
	
	
	//左右焦点
	_EsdDynamicTransformationScript.esdTagLeftNum = $("#fsD1 .prev");
	_EsdDynamicTransformationScript.esdTagRightNum = $("#fsD1 .next");
	
	//轮播后的标签
	_EsdDynamicTransformationScript.esdTagAfterNum1 = $("#bgzdt1 a");


	//轮播前的焦点
	_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
		$(document).bind("keydown.keydown_0", function (e) {
			if(e.shiftKey&&e.keyCode==9){
//				_EsdDynamicTransformationScript.esdTagFrontNum1.trigger("blur");
				
				Qfast(false, 'widgets', function () {
                    K.tabs({
                        id: 'fsD1',   //焦点图包裹id  
                        conId: "D1pic1",  //** 大图域包裹id  
                        tabId:"D1fBt",  
                        tabTn:"a",
                        conCn: '.fcon', //** 大图域配置class       
                        auto: 1,   //自动播放 1或0
                        effect: 'fade',   //效果配置
                        eType: 'click', //** 鼠标事件
                        pageBt:true,//是否有按钮切换页码
                        bns: ['.prev', '.next'],//** 前后按钮配置class                          
                        interval: 3000  //** 停顿时间  
                    }) 
               }) 
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagFrontNum1.trigger("blur");
				
				Qfast(false, 'widgets', function () {
                     K.tabs({
                         id: 'fsD1',   //焦点图包裹id  
                         conId: "D1pic1",  //** 大图域包裹id  
                         tabId:"D1fBt",  
                         tabTn:"a",
                         conCn: '.fcon', //** 大图域配置class       
                         auto: 1,   //自动播放 1或0
                         effect: 'fade',   //效果配置
                         eType: 'click', //** 鼠标事件
                         pageBt:true,//是否有按钮切换页码
                         bns: ['.prev', '.next'],//** 前后按钮配置class                          
                         interval: 3000  //** 停顿时间  
                     }) 
                }) 
				_EsdDynamicTransformationScript.esdTagLeftNum.focus();
				_EsdDynamicTransformationScript.esdTagRightNum.focus();
                 
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				console.log(document.activeElement);
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
		$(document).unbind("keydown.keydown_0");
	});
	
	

	//第一块
	_EsdDynamicTransformationScript.esdTagANum1.focus(function (e) {
		
		$(document).bind("keydown.keydown_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagANum1.trigger("blur");
				$(".syw_sgj_nav_box a:last").focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagANum1.trigger("blur");
				_EsdDynamicTransformationScript.esdTagRightNum.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum1.blur(function () {
		$(document).unbind("keydown.keydown_1");
	});

	//第二块
	_EsdDynamicTransformationScript.esdTagANum2.focus(function (e) {
		
		$(document).bind("keydown.keydown_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagANum2.trigger("blur");
				_EsdDynamicTransformationScript.esdTagLeftNum.click();
				_EsdDynamicTransformationScript.esdTagANum1.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagANum2.trigger("blur");
				_EsdDynamicTransformationScript.esdTagRightNum.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum2.blur(function () {
		$(document).unbind("keydown.keydown_2");
	});
	
	//第三块
	_EsdDynamicTransformationScript.esdTagANum3.focus(function (e) {
		
		$(document).bind("keydown.keydown_3", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagANum3.trigger("blur");
				_EsdDynamicTransformationScript.esdTagLeftNum.click();
				_EsdDynamicTransformationScript.esdTagANum2.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagANum3.trigger("blur");
				_EsdDynamicTransformationScript.esdTagRightNum.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum3.blur(function () {
		$(document).unbind("keydown.keydown_3");
	});
	
	//第四块
	_EsdDynamicTransformationScript.esdTagANum4.focus(function (e) {
		
		$(document).bind("keydown.keydown_4", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagANum4.trigger("blur");
				_EsdDynamicTransformationScript.esdTagLeftNum.click();
				_EsdDynamicTransformationScript.esdTagANum3.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagANum4.trigger("blur");
				_EsdDynamicTransformationScript.esdTagRightNum.click();
				_EsdDynamicTransformationScript.esdTagANum5.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum4.blur(function () {
		$(document).unbind("keydown.keydown_4");
	});
	
	//第五块
	_EsdDynamicTransformationScript.esdTagANum5.focus(function (e) {
		
		$(document).bind("keydown.keydown_5", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagANum5.trigger("blur");
				_EsdDynamicTransformationScript.esdTagLeftNum.click();
				_EsdDynamicTransformationScript.esdTagANum4.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagANum5.trigger("blur");
				
				Qfast(false, 'widgets', function () {
                    K.tabs({
                        id: 'fsD1',   //焦点图包裹id  
                        conId: "D1pic1",  //** 大图域包裹id  
                        tabId:"D1fBt",  
                        tabTn:"a",
                        conCn: '.fcon', //** 大图域配置class       
                        auto: 1,   //自动播放 1或0
                        effect: 'fade',   //效果配置
                        eType: 'click', //** 鼠标事件
                        pageBt:true,//是否有按钮切换页码
                        bns: ['.prev', '.next'],//** 前后按钮配置class                          
                        interval: 3000  //** 停顿时间  
                    }) 
               }) 
				
				_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esdTagANum5.blur(function () {
		$(document).unbind("keydown.keydown_5");
	});
}
/**
 * 主页js
 */


if(location.href == "http://sgj.jl.gov.cn/index.html" || location.href == "http://sgj.jl.gov.cn/"){
	
	//----------------------------------------------------- 国务院iframe 开始 --------------------------------------------------------------------

	//将iframe所包含的a链接数 第一个a元素 最后一个a元素赋值给第一个参数的js对象
	_EsdDynamicTransformationScript.getIframeInfos = function(jsObj,iframeObj){
		if(iframeObj != undefined){
			jsObj.aLink_num = iframeObj.contentWindow.document.getElementsByTagName("a").length;
			jsObj.first_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[0];
			jsObj.last_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[jsObj.aLink_num-1];
			jsObj.self = iframeObj;
		}
	};

	//声明iframe操作对象
	_EsdDynamicTransformationScript.iframe1 = {};
	_EsdDynamicTransformationScript.iframe2 = {};

	_EsdDynamicTransformationScript.iframeElement1 = document.getElementsByTagName("iframe")[0];   // 需要修改 这里的iframe获取
	_EsdDynamicTransformationScript.iframeElement2 = document.getElementsByTagName("iframe")[1];   // 需要修改 这里的iframe获取

	//选项卡标签 jquery对象
	_EsdDynamicTransformationScript.iframeTab1 = $("#tabBox1 .tabTag li:eq(0) a");  // 需要修改 这里的tab获取
	_EsdDynamicTransformationScript.iframeTab2 = $("#tabBox1 .tabTag li:eq(1) a");  // 需要修改 这里的tab获取

	// 判断iframe是否有效
	if((_EsdDynamicTransformationScript.iframeElement1!=undefined) && (_EsdDynamicTransformationScript.iframeElement2!=undefined)){

		// 当iframe都加载完毕后执行代码 使用setInterval
		_EsdDynamicTransformationScript.iframeInterval = setInterval(function(){	
			
			if((_EsdDynamicTransformationScript.iframeElement1.contentWindow.document.getElementsByTagName("a")[0]!=undefined) 
					&&_EsdDynamicTransformationScript.iframeElement2.contentWindow.document.getElementsByTagName("a")[0]!=undefined ){
				clearInterval(_EsdDynamicTransformationScript.iframeInterval);
				
				//通过方法赋值   
				_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe1,_EsdDynamicTransformationScript.iframeElement1);  
				_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe2,_EsdDynamicTransformationScript.iframeElement2); 

				//第一个标签 切换
				_EsdDynamicTransformationScript.iframeTab1.focus(function (e) {
				 console.log("tab1获取到焦点");
				 e = $(this).mouseover();
				 $(this).bind("keydown.iframeKeydown_1", function (e) {
					 if (e.shiftKey && e.keyCode == 9) {
							console.log("tab1向回切换");
						 _EsdDynamicTransformationScript.iframeTab1.trigger("blur");
						 $(".syw_sgj_swgl_zhfu2 a:last").focus();
						 return false;
					 } else if (e.keyCode == 9) {
						 console.log("tab1继续切换到iframe上");
						 _EsdDynamicTransformationScript.iframeTab1.trigger("blur");
						 $(_EsdDynamicTransformationScript.iframe1.first_aLink).focus();
						 console.log(document.activeElement);
						 return false;
					 }
				 });
				});
				_EsdDynamicTransformationScript.iframeTab1.blur(function () {
				 $(this).unbind("keydown.iframeKeydown_1");
				});

				//第一个标签的第一个链接
				$(_EsdDynamicTransformationScript.iframe1.first_aLink).focus(function () {
				 console.log("第一个iframe的第一条获得焦点");
				 $(this).bind("keydown.iframeKeydown_first1", function (e) {
					 if (e.shiftKey && e.keyCode == 9) {
							console.log("第一个iframe的第一条向上切换");
						 $(this).trigger("blur");
						 _EsdDynamicTransformationScript.iframeTab1.focus();
						 return false;
					 } else if (e.keyCode == 9) {
							console.log("第一个iframe的第一条继续切换");
					 }
				 });
				});
				$(_EsdDynamicTransformationScript.iframe1.first_aLink).blur(function () {
				 $(this).unbind("keydown.iframeKeydown_first1");
				});

				//第一个标签的最后一个链接
				$(_EsdDynamicTransformationScript.iframe1.last_aLink).focus(function () {
				 console.log("第一个iframe的最后一条获得焦点");
				 $(this).bind("keydown.iframeKeydown_first1", function (e) {
					 if (e.shiftKey && e.keyCode == 9) {
							console.log("第一个iframe的最后一条向上切换");
					 } else if (e.keyCode == 9) {
							console.log("第一个iframe的最后一条继续切换 到下一个标签");
							 $(this).trigger("blur");
						 _EsdDynamicTransformationScript.iframeTab2.focus();
						 return false;
					 }
				 });
				});
				$(_EsdDynamicTransformationScript.iframe1.last_aLink).blur(function () {
				 $(this).unbind("keydown.iframeKeydown_first1");
				});


				//第二个标签切换
				_EsdDynamicTransformationScript.iframeTab2.focus(function (e) {
				 console.log("tab2获取到焦点");
				 e = $(this).mouseover();
				 $(this).bind("keydown.iframeKeydown_2", function (e) {
					 if (e.shiftKey && e.keyCode == 9) {
							console.log("第二个标签向回切换 到第一个标签的最后一条");
						 _EsdDynamicTransformationScript.iframeTab2.trigger("blur");
						 _EsdDynamicTransformationScript.iframeTab1.mouseover();
						 $(_EsdDynamicTransformationScript.iframe1.last_aLink).focus();
						 return false;
					 } else if (e.keyCode == 9) {
						 _EsdDynamicTransformationScript.iframeTab2.trigger("blur");
						 $(_EsdDynamicTransformationScript.iframe2.first_aLink).focus();
						 console.log(document.activeElement);
						 return false;
					 }
				 });

				});
				_EsdDynamicTransformationScript.iframeTab2.blur(function () {
				 $(this).unbind("keydown.iframeKeydown_2");
				});
			}
			
		}, 500);

	}
	//----------------------------------------------------- 国务院iframe 结束 --------------------------------------------------------------------
		
		//----------------------------------------------------- 实时要闻 开始 --------------------------------------------------------------------
	_EsdDynamicTransformationScript.navTabChange = function (focusObjSelector, listObjSelector, mouseEventObjSelector, keyDownNum, listElementsSelector, prevMouseEventObjSelector, prevListObjsSelector) {
	    var keydownName = "keydown.navKeydown_" + keyDownNum;
	    var keydownName2 = keydownName + "_1";
		var keydownName3 = keydownName + "_2";
	    $(focusObjSelector).focus(function () {
			if ($(listObjSelector).is(":hidden")) {
				try{
					$(mouseEventObjSelector).mousemove();
				}catch(e){
					console.log("报错了...");
				}
			}
	        $(this).bind(keydownName, function (e) {
				console.log(123123123);
	            if (e.shiftKey && e.keyCode == 9) {
	                if (prevMouseEventObjSelector != "") {
						$(focusObjSelector).mouseout();
						try{
							$(prevMouseEventObjSelector).mousemove();
						}catch(e){
							console.log("报错了...");
						}
						$(prevListObjsSelector).last().focus();
//						$(document).unbind(keydownName);  // 失去焦点时解绑有问题在这解绑一次
						return false;
	                } else{
						$(focusObjSelector).mouseout();
						_EsdDynamicTransformationScript.esdTagAfterNum1.trigger("blur");
						
						 Qfast(false, 'widgets', function () {
			                    K.tabs({
			                        id: 'fsD1',   //焦点图包裹id  
			                        conId: "D1pic1",  //** 大图域包裹id  
			                        tabId:"D1fBt",  
			                        tabTn:"a",
			                        conCn: '.fcon', //** 大图域配置class       
			                        auto: 1,   //自动播放 1或0
			                        effect: 'fade',   //效果配置
			                        eType: 'click', //** 鼠标事件
			                        pageBt:true,//是否有按钮切换页码
			                        bns: ['.prev', '.next'],//** 前后按钮配置class                          
			                        interval: 3000  //** 停顿时间  
			                    }) 
			                }) 
			                
		            	_EsdDynamicTransformationScript.esdTagLeftNum.click();
						_EsdDynamicTransformationScript.esdTagANum5.focus();
						
//						$(document).unbind(keydownName);  // 失去焦点时解绑有问题在这解绑一次
						return false;
					}
	            } else if (e.keyCode == 9) {
					$(listElementsSelector).first().focus();
//					$(document).unbind(keydownName);
					return false;
	            }
	        });

	    });
	    $(focusObjSelector).blur(function () {
	        $(this).unbind(keydownName);
	    });
		
		$(listElementsSelector).first().focus(function () {
	        $(this).bind(keydownName2, function (e) {
	            if (e.shiftKey && e.keyCode == 9) {
					$(focusObjSelector).focus();
//					$(document).unbind(keydownName2);
					return false;
	            } else if (e.keyCode == 9) {
	                
	            }
	        });
	    });
	    $(listElementsSelector).first().blur(function () {
	        $(this).unbind(keydownName2);
	    });
		
	    $(listElementsSelector).last().focus(function () {
	        $(this).bind(keydownName3, function (e) {
	            if (e.shiftKey && e.keyCode == 9) {
					
	            } else if (e.keyCode == 9) {
	            	if($(mouseEventObjSelector).next().find("a")[0] != undefined){
	            		$(mouseEventObjSelector).mouseout();
	 					$(mouseEventObjSelector).next().mouseover();
	 					$(mouseEventObjSelector).next().find("a").focus();
//	 					$(document).unbind(keydownName3);
	 					return false;
	            	}
	            }
	        });
	    });
	    $(listElementsSelector).last().blur(function () {
	        $(this).unbind(keydownName3);
	    });
	};


	_EsdDynamicTransformationScript.tabArray = new Array();

	//第一个栏目
	_EsdDynamicTransformationScript.tab1 = {}
	_EsdDynamicTransformationScript.tab1.focusObjSelector = "#bgzdt1 a"; //按tab聚焦元素的选择器
	_EsdDynamicTransformationScript.tab1.listObjSelector = "#agzdt1"; // 按tab聚焦后展示列表选择器 用来判断列表是否已经展示  
	_EsdDynamicTransformationScript.tab1.mouseEventObjSelector = "#bgzdt1"; // 按tab聚焦后展示的列表所使用的鼠标事件绑定的元素 
	_EsdDynamicTransformationScript.tab1.keyDownNum = 1; // keydown事件标识  最好不要重复 
	_EsdDynamicTransformationScript.tab1.listElementsSelector = "#agzdt1 a"; // 按tab聚焦后 展示列表中a链接的选择器
	_EsdDynamicTransformationScript.tab1.prevMouseEventObjSelector = ""; //上一个相邻的鼠标事件(mouseover)的元素 如果是向上切换没有就使用空字符串""
	_EsdDynamicTransformationScript.tab1.prevListObjsSelector = ""; // 上一个相邻的展示列表中a链接的选择器

	_EsdDynamicTransformationScript.tabArray.push(_EsdDynamicTransformationScript.tab1);  // 放到数组里循环

	//第二个栏目
	_EsdDynamicTransformationScript.tab2 = {}
	_EsdDynamicTransformationScript.tab2.focusObjSelector = "#bgzdt2 a"; //按tab聚焦元素的选择器
	_EsdDynamicTransformationScript.tab2.listObjSelector = "#agzdt2"; // 按tab聚焦后展示列表选择器 用来判断列表是否已经展示
	_EsdDynamicTransformationScript.tab2.mouseEventObjSelector = "#bgzdt2"; // 按tab聚焦后展示的列表所使用的鼠标事件绑定的元素 
	_EsdDynamicTransformationScript.tab2.keyDownNum = 2; // keydown事件标识  最好不要重复
	_EsdDynamicTransformationScript.tab2.listElementsSelector = "#agzdt2 a"; // 按tab聚焦后 展示列表中a链接的选择器
	_EsdDynamicTransformationScript.tab2.prevMouseEventObjSelector = "#bgzdt1"; //上一个相邻的鼠标事件(mouseover)的元素 如果是向上切换没有就使用空字符串""
	_EsdDynamicTransformationScript.tab2.prevListObjsSelector = "#agzdt1 a"; // 上一个相邻的展示列表中a链接的选择器

	_EsdDynamicTransformationScript.tabArray.push(_EsdDynamicTransformationScript.tab2);  // 放到数组里循环

	//第三个栏目
	_EsdDynamicTransformationScript.tab3 = {}
	_EsdDynamicTransformationScript.tab3.focusObjSelector = "#bgzdt3 a"; //按tab聚焦元素的选择器
	_EsdDynamicTransformationScript.tab3.listObjSelector = "#agzdt3"; // 按tab聚焦后展示列表选择器 用来判断列表是否已经展示
	_EsdDynamicTransformationScript.tab3.mouseEventObjSelector = "#bgzdt3"; // 按tab聚焦后展示的列表所使用的鼠标事件绑定的元素 
	_EsdDynamicTransformationScript.tab3.keyDownNum = 3; // keydown事件标识  最好不要重复
	_EsdDynamicTransformationScript.tab3.listElementsSelector = "#agzdt3 a"; // 按tab聚焦后 展示列表中a链接的选择器
	_EsdDynamicTransformationScript.tab3.prevMouseEventObjSelector = "#bgzdt2"; //上一个相邻的鼠标事件(mouseover)的元素 如果是向上切换没有就使用空字符串""
	_EsdDynamicTransformationScript.tab3.prevListObjsSelector = "#agzdt2 a"; // 上一个相邻的展示列表中a链接的选择器

	_EsdDynamicTransformationScript.tabArray.push(_EsdDynamicTransformationScript.tab3);  // 放到数组里循环

	//第四个栏目
	_EsdDynamicTransformationScript.tab4 = {}
	_EsdDynamicTransformationScript.tab4.focusObjSelector = "#bgzdt4 a"; //按tab聚焦元素的选择器
	_EsdDynamicTransformationScript.tab4.listObjSelector = "#agzdt4"; // 按tab聚焦后展示列表选择器 用来判断列表是否已经展示
	_EsdDynamicTransformationScript.tab4.mouseEventObjSelector = "#bgzdt4"; // 按tab聚焦后展示的列表所使用的鼠标事件绑定的元素 
	_EsdDynamicTransformationScript.tab4.keyDownNum = 4; // keydown事件标识  最好不要重复
	_EsdDynamicTransformationScript.tab4.listElementsSelector = "#agzdt4 a"; // 按tab聚焦后 展示列表中a链接的选择器
	_EsdDynamicTransformationScript.tab4.prevMouseEventObjSelector = "#bgzdt3"; //上一个相邻的鼠标事件(mouseover)的元素 如果是向上切换没有就使用空字符串""
	_EsdDynamicTransformationScript.tab4.prevListObjsSelector = "#agzdt3 a"; // 上一个相邻的展示列表中a链接的选择器

	_EsdDynamicTransformationScript.tabArray.push(_EsdDynamicTransformationScript.tab4);  // 放到数组里循环



	for(var i=0; i<_EsdDynamicTransformationScript.tabArray.length; i++){
		_EsdDynamicTransformationScript.navTabChange(_EsdDynamicTransformationScript.tabArray[i].focusObjSelector, _EsdDynamicTransformationScript.tabArray[i].listObjSelector, 
			_EsdDynamicTransformationScript.tabArray[i].mouseEventObjSelector, _EsdDynamicTransformationScript.tabArray[i].keyDownNum, _EsdDynamicTransformationScript.tabArray[i].listElementsSelector,
			_EsdDynamicTransformationScript.tabArray[i].prevMouseEventObjSelector, _EsdDynamicTransformationScript.tabArray[i].prevListObjsSelector);
	}

	$(".syw_sgj_swgl_text ul li:eq(0) a").focus(function () {
	        $(document).bind("keydown.navKeydown_33", function (e) {
	            if (e.shiftKey && e.keyCode == 9) {
					try{
						$(_EsdDynamicTransformationScript.tab4.mouseEventObjSelector).mousemove();
					}catch(e){
						console.log("报错了...");
					}
					$(_EsdDynamicTransformationScript.tab4.listObjSelector).last().focus();
					$(document).unbind("keydown.navKeydown_33");
					return false;
	            } else if (e.keyCode == 9) {
	                
	            }
	        });
	    });
	$(".syw_sgj_swgl_text ul li:eq(0) a").last().blur(function () {
		$(document).unbind("keydown.navKeydown_33");
	});

	
	//----------------------------------------------------- 实时要闻 结束 --------------------------------------------------------------------
		
	
}
/**
 * 二级页
 */

//------------------------------二级页------------------------------------
if(location.href=="http://sgj.jl.gov.cn/hdjl/"){  //局长信箱
	_EsdDynamicTransformationScript.iframeInputInterval = setInterval(function(){	
		if(document.getElementsByTagName("iframe")[0].contentWindow.document.getElementsByTagName("input")[0]!=undefined){
			clearInterval(_EsdDynamicTransformationScript.iframeInputInterval);
			var inputIframe = document.getElementsByTagName("iframe")[0].contentWindow.document;
		    $(inputIframe).find("#frmData textarea:eq(0)").attr({placeholder:"姓名",title:"姓名"});
			$(inputIframe).find("#frmData textarea:eq(1)").attr({placeholder:"电子邮箱",title:"电子邮箱"});
			$(inputIframe).find("#frmData textarea:eq(2)").attr({placeholder:"联系电话",title:"联系电话"});
			$(inputIframe).find("#frmData textarea:eq(3)").attr({placeholder: "邮政编码",title:"邮政编码"});
			$(inputIframe).find("#frmData select:eq(0)").attr({title:"证件类型"});
			$(inputIframe).find("#frmData textarea:eq(4)").attr({placeholder: "证件编码",title:"证件编码"});
			$(inputIframe).find("#frmData textarea:eq(5)").attr({placeholder:"手机号码",title:"手机号码"});
			$(inputIframe).find("#frmData textarea:eq(6)").attr({placeholder:"联系地址",title:"联系地址"});
			$(inputIframe).find("#frmData textarea:eq(7)").attr({placeholder:"留言标题",title:"留言标题"});
			$(inputIframe).find("#frmData textarea:eq(8)").attr({placeholder:"留言内容",title:"留言内容"});
		}	
	}, 500);
	
}
/**
 * 共通底部处理
 */
//定义跳转 使用jquery选择器语法
//主要修改部分把网站对应的选择器赋值给相应的变量。或用jquery把默认的id复制给网站的元素****************************此处重要位置修改
_EsdDynamicTransformationScript.navBlock.selector.top = ".syw_sgj_head_top";
_EsdDynamicTransformationScript.navBlock.selector.nav = ".syw_sgj_nav_box";
_EsdDynamicTransformationScript.navBlock.selector.footer = ".syw_sgj_foot_box";
_EsdDynamicTransformationScript.navBlock.selector.main = ".syw_sgj_content_box";    
_EsdDynamicTransformationScript.navBlock.selector.left = ".syw_jgzn_lm";  
_EsdDynamicTransformationScript.navBlock.selector.right = ".syw_jgzn_content";
_EsdDynamicTransformationScript.navBlock.selector.content = ".syw_jxjy_xl_main";

//给栏目的class属性添加navBlock值来标识这是需要切的栏目区块。
_EsdDynamicTransformationScript.navBlock.activateArray = [
	".syw_sgj_head_top", ".syw_sgj_head_box", ".syw_sgj_nav_box", ".syw_sgj_content_box", ".syw_sgj_jdt_box", ".syw_sgj_ycdt_box", 
	".syw_sgj_jdt_hb", ".syw_sgj_swgl_box", ".syw_sgj_swgl_zhfu", ".syw_sgj_bannder", ".syw_sgj_xxzz_box", ".syw_sgj_xxgk_box", 
	".syw_sgj_syjlhd_text1", ".syw_sgj_syjlhd_text2", ".syw_sgj_syjlhd_text3" ]
	
if(location.href=="http://sgj.jl.gov.cn/xwzx/"){// 根据不同的二级页添加的标记
	_EsdDynamicTransformationScript.navBlock.activateArray = 
		_EsdDynamicTransformationScript.navBlock.activateArray.concat([".syw_jgzn_lm", ".syw_xwzx_sjdt:eq(0)", ".syw_xwzx_sjdt:eq(1)", ".syw_xwzx_box3"]);
}
//尾部
_EsdDynamicTransformationScript.navBlock.activateArray = 
	_EsdDynamicTransformationScript.navBlock.activateArray.concat([".syw_jgzn_lm", ".syw_sgj_xwzxtzgg", ".syw_jgzn_content", ".syw_jxjy_xl_main", ".syw_sgj_foot_box"]);


for(var i=0; i<_EsdDynamicTransformationScript.navBlock.activateArray.length;i++){
	$(_EsdDynamicTransformationScript.navBlock.activateArray[i]).addClass("navBlock");
}
/**
 * 区域导航、调试开关
 */

$(document).bind("keydown.keydown_9001", function(e) {
	if (e.shiftKey && e.keyCode == 20) {
		$("*").focus(function() {
			$(this).css({
				"outline" : "2px dashed red"
			});
		});
		$("*").blur(function() {
			$(this).css({
				"outline" : "0px black"
			});
		});
	}
});

_EsdDynamicTransformationScript.navBlock.debug = true; // 是否是调试模式，调试模式有红边线，非调试模式关闭红边框
_EsdDynamicTransformationScript.navBlock.selector.activate = ".navBlock"; // 激活的采用class因为会激活多个
// 快捷键定义区
//_EsdDynamicTransformationScript.navBlock.key = {};

//_EsdDynamicTransformationScript.navBlock.key.top = "alt+1"; // (top)
//_EsdDynamicTransformationScript.navBlock.key.nav = "alt+2"; // (nav)
//_EsdDynamicTransformationScript.navBlock.key.main = "alt+3"; // (main)
//_EsdDynamicTransformationScript.navBlock.key.content = "alt+4"; // (content)
//_EsdDynamicTransformationScript.navBlock.key.left = "alt+5"; // (left)
//_EsdDynamicTransformationScript.navBlock.key.right = "alt+6"; // (right)
//_EsdDynamicTransformationScript.navBlock.key.footer = "alt+7"; // (footer)
//_EsdDynamicTransformationScript.navBlock.key.down = "alt+8"; // (down)
//_EsdDynamicTransformationScript.navBlock.key.up = "alt+9"; // (up);

// 以下变量主要用于区块跳转
_EsdDynamicTransformationScript.navBlock.sIndex = -1; // 当前栏目下标
_EsdDynamicTransformationScript.navBlock.maxIndex = -1; // 保存目前所有class="navBlock"的区域块总数量，栏目总量下标。
_EsdDynamicTransformationScript.navBlock.minIndex = 0; // 栏目数量起始下标

// 主要代码区域

// 导航跳转
_EsdDynamicTransformationScript.navBlock.keyShowSelect = function(i) {
	$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, el) {
		if (i == index) {
			_EsdDynamicTransformationScript.navBlock.debugView(el);
			$(el).find("a").each(function(i, e) {
				if (i == 0) {
					$(e).focus();
				}
			});

		}
	});
}

// 获取所有class=navBlock的区域的总数量，初始化轮训所有需要跳转的块
$(_EsdDynamicTransformationScript.navBlock.selector.activate).each(function(index, ehx) {
	_EsdDynamicTransformationScript.navBlock.maxIndex++;
});



// 快捷键功能区域
// 跳转到头部alt+1(49)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 49) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.top);
	}

});
// 跳转到导航alt+2(50)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 50) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.nav);
	}

});
// 跳转到主要区域alt+3(51)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 51) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.main);
	}
});

// 跳转到正文区域alt+4(52)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 52) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.content);
	}
});

// 跳转到左区域alt+5(53)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 53) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.left);
	}
});

// 跳转到右区域alt+6(54)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 54) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.right);
	}
});
// 跳转到底部alt+7(55)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 55) {
		_EsdDynamicTransformationScript.navBlock.keySelectScroll(_EsdDynamicTransformationScript.navBlock.selector.footer);
	}
});
//前进alt+8(56)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 56) {
		if (_EsdDynamicTransformationScript.navBlock.sIndex < _EsdDynamicTransformationScript.navBlock.maxIndex) {
			_EsdDynamicTransformationScript.navBlock.sIndex++;
			_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
		}
	}
});

// 后退alt+9(57)
$(document).keydown(function(e) {
	if (e.altKey && e.keyCode == 57) {
		if (_EsdDynamicTransformationScript.navBlock.sIndex > _EsdDynamicTransformationScript.navBlock.minIndex) {
			_EsdDynamicTransformationScript.navBlock.sIndex--;
			_EsdDynamicTransformationScript.navBlock.keyShowSelect(_EsdDynamicTransformationScript.navBlock.sIndex);
		}
	}
});
// 特定区域跳转
_EsdDynamicTransformationScript.navBlock.keySelectScroll = function(id) {
	if ($(id).length > 0) {
		_EsdDynamicTransformationScript.navBlock.appendIns(id,true);//插入ins
		_EsdDynamicTransformationScript.navBlock.debugView(id);
		$(id).find("a").each(function(index) {
			if (index == 0) {
				$(this).focus();
			}
		});
		_EsdDynamicTransformationScript.navBlock.appendIns(id,false);//清楚ins
	} else {
	}

}
//为了解决漂浮高等于0的情况下区域显示是一条线
_EsdDynamicTransformationScript.navBlock.appendIns=function(id,b){
	if(b==true){
		$(id).append("<ins id='esdNavBlockIns' style='clear: both;display: block;'></ins>")
	}else{
		$("#esdNavBlockIns").remove();
	}
}

if (_EsdDynamicTransformationScript.navBlock.debug == true) {
	// 如果开启调试模式，添加调试绘制矩形边线
	$("body").append("<div id='show_top' class='lineshow'></div>");
	$("body").append("<div id='show_bottom' class='lineshow'></div>");
	$("body").append("<div id='show_left' class='lineshow'></div>");
	$("body").append("<div id='show_right' class='lineshow'></div>");
	$(".lineshow").css({
		"display" : "none"
	});
}
// 开启调试模式后会显示红边
_EsdDynamicTransformationScript.navBlock.debugView = function(e) {
	if (_EsdDynamicTransformationScript.navBlock.debug == true) {
		var x = $(e).offset();
		//var w = parseInt($(e).css("width"));
		var w = $(e).outerWidth();//返回元素的宽度（包含 padding 和 border）
		//var h = parseInt($(e).css("height"));
		var h = $(e).outerHeight();//返回元素的高度（包含 padding 和 border）
		$("#show_top").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left,
			"width" : w,
			"height" : "0px"
		});
		$("#show_bottom").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top + h,
			"left" : x.left,
			"width" : w,
			"height" : "0px"
		});
		$("#show_left").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left,
			"width" : "0px",
			"height" : h
		});
		$("#show_right").css({
			"z-index" : "9999",
			"border" : "red 2px solid",
			"position" : "absolute",
			"top" : x.top,
			"left" : x.left + w,
			"width" : "0px",
			"height" : h
		});
		$("html,body").animate({
			scrollTop : $("#show_top").offset().top
		}, 200);
		$(".lineshow").css({
			"display" : "block"
		});
	}
}
};
/**
 * 主入口方法
 */

if (window.jQuery == undefined) {
	var wzaInitInterval = setInterval(function(){	
		if(document.body!=null){
			clearInterval(wzaInitInterval);
			document.body.onload = function(){
				var esdJquery = document.createElement("script");
				esdJquery.setAttribute("type", "text/javascript");
				esdJquery.setAttribute("src", window.location.protocol + "//" + window.location.href.split("/")[2] + "/wza/bwscript/jquery-1.12.4.min.js");
				esdJquery.setAttribute("charset", "utf-8");
				esdJquery.setAttribute("id", "ESDWebAppInnerIframe");
				document.body.appendChild(esdJquery);
				var jqueryLoadInterval = setInterval(function () {
					if (window.jQuery != undefined) {
						clearInterval(jqueryLoadInterval);
						_EsdDynamicTransformationFunction(jQuery);
					}
				}, 500);
			};	
		}
	}, 500);
} else {
	jQuery(function(){
		_EsdDynamicTransformationFunction(jQuery);
	})
	
}
